﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TabLines.ascx.cs" Inherits="BigLotterySyndicate.Secured.Draws.Controls.TabLines" %>
<asp:MultiView ID="MultiViewList" runat="server">
<asp:View ID="ViewList" runat="server">
<table cellpadding="2" cellspacing="2" style="float:left" border="0">
<thead>
<tr>
<th></th>
<th></th>
<th class="left">Results:
</th>
</tr>
<tr>
<th></th>
<th></th>
<th><%= PrintResults() %>
</th>
</tr>
<tr>
<th></th>
<th>
<asp:PlaceHolder ID="PlaceHolderGlobalCheckBox" runat="server" >
<script type="text/javascript">
    document.write("<input type='checkbox' id='CheckboxToggleParent' onclick='ToggleAllCheckboxes(this)'/>");

    function ToggleAllCheckboxes(el) {
        var state = el.checked;
        while (el && el.tagName.toLowerCase() != "table") {
            el = el.parentNode;
        }
        if (el) {
            var inputs = el.getElementsByTagName("input");
            for (var idx = 0; idx < inputs.length; idx++) {
                if (inputs[idx].id != "CheckboxToggleParent" && inputs[idx].type.toLowerCase() == "checkbox")
                    inputs[idx].checked = state;
            }
        }
    }
                            </script>
                            <noscript>&nbsp;</noscript>
                            </asp:PlaceHolder>
</th>
<th class="left"><div style="width:305px;float:left">Numbers played</div><div class="result">Matches</div></th>
</tr>
</thead>
<tbody>
<asp:Repeater ID="RepeaterList" runat="server">
    <ItemTemplate>
    <tr>
    <td><%# Container.ItemIndex+1 %>.</td>
    <td>
    <asp:PlaceHolder ID="PlaceHolderAction" runat="server">
    <input type="checkbox" runat="server" id="chkAction"/>
    </asp:PlaceHolder>
    </td>
    <td>
    <%# PrintNumbers(Container.DataItem) %>
    </td>
    </tr>  
    </ItemTemplate>    
    
</asp:Repeater>
</tbody>
<tfoot>
<tr>
<td colspan="3"><asp:Button ID="ButtonRemove" Text="Remove selected lines" 
        runat="server" onclick="ButtonRemove_Click" /></td>
</tr>
</tfoot>
</table>

</asp:View>
<asp:View ID="ViewEmpty" runat="server">
<p>No lines found.</p>
</asp:View>
</asp:MultiView>
<asp:PlaceHolder ID="PlaceHolderDrawOpen" runat="server">
<p style="float:left; width:100%;">
Remaining funds: <%= PrintRemaining() %>
</p>
<p style="float:left; width:100%;">
<asp:HyperLink ID="linkAddLine" Text="Add new line" runat="server"></asp:HyperLink>
</p>
<p style="float:left; width:100%;">
<asp:HyperLink ID="linkAddOldLines" Text="Add lines from previous draw" runat="server"></asp:HyperLink>
</p>
</asp:PlaceHolder>